#region Imported Namespaces
using System;
using System.Collections.Specialized;
using System.Data;
using System.Web.UI.WebControls;

using PHSRAG.Insight21.Context;
using BO = PHSRAG.Insight21.BusinessObjects;
using DataAccess = PHSRAG.Utility.DataAccess;
using ICachePolicy = PHSRAG.Insight21.Policy.ICachePolicy;
using GenerateKey = PHSRAG.Insight21.BusinessObjects.ModuleKey;
#endregion

namespace PHSRAG.Insight21.SearchContext
{
    /// <summary>
    /// Summary description for AnimalsSeachContext.
    /// </summary>
    public class AnimalsSearchContext : SearchContext
    {
        #region Constants
        private static string AnimalsSearchContextKey = GenerateKey.MakeKey("AnimalsSearchContext_4E285DB6-3B8A-46bb-9DB7-494C9AD19558", GenerateKey.Animals);
        #endregion

        #region Constructor
        /// <summary>
        /// Create an instance of the AnimalsSearchContext class. Since this object does not hold any state 
        /// (other than whatever the base class holds), there is nothing to initialize.
        /// </summary>
        /// <param name="cachePolicy">Cache policy to use</param>
        public AnimalsSearchContext(ICachePolicy cachePolicy)
            : base(cachePolicy)
        {
            DataContainer = new DataSet();
        }

        #endregion

        #region Class Properties
        /// <summary>
        /// Get the key to be used in all caching operations for this instance of the object.
        /// </summary>
        public static string CacheKey { get { return AnimalsSearchContextKey; } }

        #endregion

        #region Overrides
        /// <summary>
        /// Adds the AnimalsSearchContext object to the cache
        /// </summary>
        public override void Cache()
        {
            CachePolicy.Cache(CacheKey, this);
        }

        /// <summary>
        /// Removes the AnimalsSearchContext object from the cache
        /// </summary>
        public override void UnCache()
        {
            CachePolicy.UnCache(CacheKey);
        }

        /// <summary>
        /// Load Animals search data for any drop-down lists into the data container.
        /// Currently, does nothing since there are no drop-down lists
        /// </summary>
        /// <param name="connectionString">Connection string to the database</param>
        /// <param name="args">Arugments to the invoked stored procedure</param>
        public override void Load(string connectionString, params object[] args)
        {

        }
        #endregion

        #region SearchContext Members
        /// <summary>
        /// Reset the internal search state.
        /// </summary>
        public override void Reset(string pageName)
        {
            DataContainer.Reset();
        }
        #endregion
    }
}
